<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/inc/taglib.inc" %>
<%@ include file="/WEB-INF/inc/script.inc" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<base href="${base}">
    <title>中金通 | 营销管理</title>
    
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
    <!-- FooTable -->
   <!--  <link href="css/plugins/footable/footable.core.css" rel="stylesheet"> -->
    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
    <link href="css/plugins/jsTree/style.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">
 <style type="text/css">
.datepicker{
	z-index: 3000;
}
.modal{
	z-index: 10;
}
</style>
</head>

<body >

    <div id="wrapper">

    	<!-- 左侧菜单 -->
        <jsp:include page="/WEB-INF/jsp/common/main-menu.jsp"></jsp:include>

        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
        <!-- 头部工具栏区 -->
        <jsp:include page="/WEB-INF/jsp/common/main-header.jsp"></jsp:include>
        </div>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>营销管理</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="common/platform">Home</a>
                        </li>
                        <li>
                            <a href="message/list">消息推送</a>
                        </li>
                        <li class="active">
                            <strong>通知列表</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>

        <div class="row" style="margin-top:10px;">
        <div class="col-md-12">
        	<div class="tabs-container">
	        <ul class="nav nav-tabs">
	            <li class="active">
					<a href="appointment/list">
						 通知列表
					</a>
				</li>
	        </ul>
		<div class="tab-content">
              <div class="tab-pane active">
                  <div class="panel-body">
                      <div class="wrapper wrapper-content animated fadeInRight ecommerce">
		<form action="list" id="queryForm" name="queryForm" method="post" class="myform">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label" for="date_added">发送时间</label>
                            <div class="input-group date">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span><input id="date_added" type="text" name="startTime" class="form-control added" data-date-format="yyyy-mm-dd"  >
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label" for="date_modified">&nbsp;</label>
                            <div class="input-group date">
                            	   <span class="input-group-addon">至 <i class="fa fa-calendar"></i></span><input id="date_modified" type="text" name="endTime" class="form-control modified" data-date-format="yyyy-mm-dd"  >
                            </div>
                        </div>
                    </div>
                </div>
				<p class="col-sm-offset-5">
				 	<button type="button" id="btn_query" class="btn btn-primary">查询</button>
					<button type="reset" class="btn btn-outline btn-default">重置</button>
                    <button type="button" class="btn btn-primary" id="btn_send" data-toggle="modal" data-target="#myModal">发送通知</button>
                    <button type="button" style="display:none;" id="btn_detail" data-toggle="modal" data-target="#myDetail">详情</button>
                </p>
		</form>
	            <div class="row">
	                <div class="col-lg-12">
							 <div class="ibox float-e-margins">
		                        <div class="ibox-content">
		                            <table id="modelEditable" class="table table-striped table-bordered table-hover">
		                                <thead>
		                                <tr>
		                                    <th style="background-color:white;">通知内容</th>
		                                    <th style="background-color:white;">来源</th>
		                                    <th style="background-color:white;">发送对象</th>
		                                    <th style="background-color:white;">发送时间</th>
		                                    <th style="background-color:white;">操作</th>
		                                </tr>
		                                </thead>
		                                <tbody>
		                                </tbody>
		                            </table>
		
		                        </div>
		                    </div>
	                </div>
	            </div>
		  </div>
	     </div>
	    </div>
	   </div>
	  </div>
	</div>
        </div>
        <div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"  style="z-index:10;">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                            </button>
                            <h4 class="modal-title">发送通知</h4>
                    </div>
                    <div class="modal-body" style="height:300px;">
                   		 <form method="post" id="sendForm" enctype="multipart/form-data" action="investor/doAdd" class="form-horizontal">
                    		<div class="form-group"><label class="col-sm-2 control-label"><br/>
                                <small class="text-navy">发送对象</small></label>
                                <div class="col-sm-8">
                                    <div><br/><label> <input type="radio"  value="1"  name="type">PC端</label></div>
                                    <div><label> <input type="radio" checked="" value="2"  name="type">Pad端</label></div>
                                </div>
                            </div>
                            <div class="form-group has-success"><label class="col-sm-2 control-label">通知内容</label>
                                <textarea type="text" style="resize:none;height:180px;width:410px;font-family:inherit;" id="message" name="message" class="form-control"></textarea>
                            </div>
                            <div style="diasplay:none;" class="alert alert-danger display-hide" >
								通知长度必须在1至1024个字符之间
							</div> 
                          </form>  
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal" id="btn_close_send">取消</button>
                        <button type="button" class="btn btn-primary" id="btn_send_message">发送</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal inmodal " id="myDetail" tabindex="-1" role="dialog" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content animated fadeIn">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                            </button>
                            <h4 class="modal-title">通知详情</h4>
                    </div>
                    <div class="modal-body" style="height:300px;">
                    		<div class="form-group has-success"><label class="col-sm-2 control-label">发送对象</label>
                                	<span type="text" disabled id="send_object"></span>
                            </div>	
                            <div class="form-group has-success"><label class="col-sm-2 control-label">通知内容</label>
                                <textarea type="text" readonly style="resize:none;height:180px;width:80%;font-family:inherit;" id="message_detail" ></textarea>
                            </div>
                            <div class="form-group has-success"><label class="col-sm-2 control-label">发送时间</label>
                            	<span id="create_time" type="text" disabled ></span>
                            </div>
                    </div>
                    <div class="modal-footer">
                    </div>
                </div>
            </div>
        </div>
        <!-- 底部版权 -->
        <jsp:include page="/WEB-INF/jsp/common/main-footer.jsp"></jsp:include>

        </div>
        </div>



    <!-- Mainly scripts -->
   
    <script src="js/jquery-2.1.1.js"></script>
    <script src="js/jquery-ui-1.10.4.min.js"></script>
    <script src="js/plugins/validate/jquery.validate.min.js"></script>
    <script src="js/plugins/jeditable/jquery.jeditable.js"></script>
	<script src="js/jquery.serialize-object.min.js" type="text/javascript"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<script src="js/plugins/daterangepicker/daterangepicker.js"></script>
	
    <!-- Custom and plugin javascript -->
    <script src="js/inspinia.js"></script>
    <script src="js/plugins/pace/pace.min.js"></script>
	<script src="js/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
    
    <!-- Data picker -->
    <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
    
    <!-- Data Tables -->
    <script src="js/plugins/dataTables/jquery.dataTables.min.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="js/plugins/dataTables/dataTables.responsive.js"></script>
    <script src="js/plugins/dataTables/dataTables.tableTools.min.js"></script>
     <!-- 业务js -->
    <script src="js/plugins/jsTree/jstree.min.js"></script>
    <script src="js/message/list.js?v=${jsVersion}"></script>
    <script src="js/investor/utils.js?v=${jsVersion}"></script>
    <!-- Page-Level Scripts -->
    <script>	
        $(document).ready(function() {
        	InvestorModule.init();
            $('#date_added').datepicker({
                todayBtn: "linked",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: true,
                autoclose: true
            });
            
           $('#date_added').datepicker()
            .on('changeDate', function(ev){
             	var date = $('#date_added').val();
             	var date2 = $('#date_modified').val();
             	var startDate = Date.parse(date);
             	var endDate = Date.parse(date2);
             	var today = new Date();
             	var todayTime = today.getTime();
                	if(startDate >= todayTime){
                		bootbox.alert("查询开始时间不能大于当前时间");
                		$('#date_added').val("");
                	}else if(startDate > endDate){
                		bootbox.alert("查询开始时间不能大于截止时间.");
                		$('#date_added').val("");
                	}
                	$('#date_added').datepicker('hide');
            }); 
            
            $('#date_modified').datepicker({
                todayBtn: "linked",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: true,
                autoclose: true
             });
            $('#date_modified').datepicker()
           	  .on('changeDate', function(ev){
           		var date = $('#date_added').val();
           		var date2 = $('#date_modified').val();
             	var startDate = Date.parse(date);
             	var endDate = Date.parse(date2);
             	var today = new Date();
             	var todayTime = today.getTime();
                	if(endDate >= todayTime){
                		bootbox.alert("查询截止时间不能大于当前时间.");
                		$('#date_modified').val("");
                	}else if(startDate > endDate){
                		bootbox.alert("查询截止时间不能小于开始时间.");
                		$('#date_modified').val("");
                	}
                	$('#date_modified').datepicker('hide');
         		});
        });
        
    </script>

</body>

</html>
